package nyu.edu.database.data;

public class DataItem {

	private final int dataId;
	private int dataValue;
	private final static int ammountOfItems = 20;

	private DataItem(int dataId) {
		super();
		this.dataId = dataId;
		dataValue = 0;
	}

	private DataItem(int dataId, int dataValue) {
		super();
		this.dataId = dataId;
		this.dataValue = dataValue;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + dataId;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		DataItem other = (DataItem) obj;
		if (dataId != other.dataId)
			return false;
		return true;
	}

	public static DataItem[] initializeDataItems() {
		DataItem[] myItems = new DataItem[ammountOfItems];
		for (int x = 1; x < ammountOfItems + 1; x++) {
			myItems[x - 1] = new DataItem(x, (10 * x));
		}
		return myItems;

	}

	/*****************************
	 * Begin Getters And Setters *
	 *****************************/
	public int getDataValue() {
		return dataValue;
	}

	public void setDataValue(int dataValue) {
		this.dataValue = dataValue;
	}

	public int getDataId() {
		return dataId;
	}

}
